# System-wide configuration

[api]
# Host and port to bind the API server.
host = {{ ansible_default_ipv4.address }}
port = {{ st2_port.api }}
logging = /etc/st2/logging.api.gunicorn.conf
mask_secrets = True
# allow_origin is required for handling CORS in st2 web UI.
# allow_origin = http://myhost1.example.com:3000,http://myhost2.example.com:3000

[stream]
logging = /etc/st2/logging.stream.gunicorn.conf

[sensorcontainer]
logging = /etc/st2/logging.sensorcontainer.conf

[rulesengine]
logging = /etc/st2/logging.rulesengine.conf

[actionrunner]
logging = /etc/st2/logging.actionrunner.conf
virtualenv_opts =
workflows_pool_size = {{ ansible_processor_vcpus * 10 }}
actions_pool_size = {{ ansible_processor_vcpus * 15 }}

[resultstracker]
logging = /etc/st2/logging.resultstracker.conf

[notifier]
logging = /etc/st2/logging.notifier.conf

[exporter]
logging = /etc/st2/logging.exporter.conf

[garbagecollector]
logging = /etc/st2/logging.garbagecollector.conf

[timersengine]
logging = /etc/st2/logging.timersengine.conf

[auth]
host = {{ ansible_default_ipv4.address }}
port = {{ st2_port.auth }}
use_ssl = False
debug = False
enable = True
logging = /etc/st2/logging.auth.gunicorn.conf

mode = standalone

# Note: Settings below are only used in "standalone" mode
backend = flat_file
backend_kwargs = {"file_path": "/etc/st2/htpasswd"}

# Base URL to the API endpoint excluding the version (e.g. http://myhost.net:9101/)
api_url =

[system]
base_path = /opt/stackstorm

[webui]
# webui_base_url = https://mywebhost.domain

[syslog]
host = {{ st2_syslog_server | list | random(seed=inventory_hostname) }}
port = {{ st2_syslog_port }}
facility = local7
protocol = {{ st2_syslog_protocol }}

[log]
excludes = requests,paramiko
redirect_stderr = False
mask_secrets = True

[system_user]
user = {{ st2_sys_user }}
ssh_key_file = /home/{{ st2_sys_user }}/.ssh/{{ st2_sys_user }}_rsa

[messaging]
url = amqp://{{ st2_rabbitmq_bu_arg[0].user }}:{{ st2_rabbitmq_bu_arg[0].pass }}@{{ st2_rabbitmq_host }}:{{ st2_rabbitmq_port.tcp }}/

[ssh_runner]
remote_dir = /tmp

[workflow_engine]
logging = /etc/st2/logging.workflowengine.conf

[scheduler]
logging = /etc/st2/logging.scheduler.conf

[database]
host = mongodb://{% if st2_mongod_auth %}{{ st2_mongod_user }}:{{ st2_mongod_pass | urlencode }}@{% endif %}{{ st2_mongod_hosts | list | join(",") }}:{{ st2_mongod_port }}/ST2{% if ( st2_mongod_replset is defined ) and ( st2_servers|length is not divisibleby 2 ) and ( st2_servers|length > 2 ) %}?replicaSet={{ st2_mongod_replset | default("ST2") | upper }}{% endif %}


[keyvalue]
encryption_key_path = /etc/st2/keys/datastore_key.json

[metrics]
driver = statsd
host = {{ ansible_default_ipv4.address }}
port = {{ st2_port.metrics }}
